$(()=>{
    let $get = $("#get");
    let $inputbox = $("#inputbox");
    $inputbox.focus();
    let $main = $("#main");
    let $table = $("#table");
    let $item1 = $("#item1");
    let $item2 = $("#item2");
   /* let $video_title = $("#video_title");
    let $video_description = $("#video_description");
    let $video_cover = $("#video_cover");
    let $video_play = $("#video_play");
    let $video_link = $("#video_link");*/
    $inputbox.keydown(e=>{if (e.keyCode===13)$get.click();});
    $(document).keydown(e=>{if(e.keyCode===36){if(e.ctrlKey){if(confirm("是否要返回上一页？")){location.href = "./?/index";}}else{if(confirm("是否要返回首页？")){history.back();}}}});
    $get.click(()=>{
        $main.addClass("el-loading");
        let link = $inputbox.val();
        $.post("#",{
            link:link
        },text=>{
            $main.removeClass("el-loading");
            $table.hide();
            $table.removeClass("el-loading");
            $item1.text(link);
            $item2.html(`<img alt="网站图标" src="${text}" width="300">`);
            $table.fadeIn();
            console.log(text);
        });
    });
});
